package com.springBootStudy.annotation.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @ program: elasticSearch_springBoot_study
 * @ description:
 * @ author: Mr.Zhongsf
 * @ create: 2021-03-10 09:36
 **/


//这个注解说明这个类被 spring接管了,注册到了容器中
@Component
public class UserMy {

    //属性注入值是zsf
    @Value("zsf")
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "UserConfig{" +
                "name='" + name + '\'' +
                '}';
    }
}
